package com.misboot.document.client.fallbackFactory;

import cn.ewsd.common.controller.BaseController;
import com.misboot.document.client.MdataClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


/**
 * misboot-mdata相关接口 模块降级处理
 *
 * @Author 湖南佐佑时代科技有限公司
 * @Version 5.4.21
 * @Email service@zuoyo.com
 * @Date 2022-06-16 13:31:39
 */
@Component
public class MdataClientFallbackFactory extends BaseController implements FallbackFactory<MdataClient> {

    private static final Logger log = LoggerFactory.getLogger(MdataClientFallbackFactory.class);


    @Override
    public MdataClient create(Throwable throwable) {
        log.error("misboot-mdata模块服务调用失败:{}", throwable.getMessage());

        return new MdataClient() {

            @Override
            public Map<String, Object> getUserByUuid(String uuid) {
                return null;
            }

            @Override
            public String getRoleIdByUserNameId(String userNameId) {
                return null;
            }

            @Override
            public Integer checkUserExistByUserNameId(String userNameId) {
                return null;
            }

            @Override
            public Map<String, Object> getUserByOrgIdAndPosition(String orgId, String position) {
                return null;
            }

            @Override
            public Map<String, Object> getListByNameAndOrgid(String userDutyName, String userOrgId) {
                return null;
            }

            @Override
            public Map<String, Object> getListById(String id) {
                return null;
            }

            @Override
            public Map<String, Object> getUserByUserNameId(String userNameId) {
                return null;
            }

            @Override
            public Map<String, Object> getUserByCuuid(String myUuid) {
                return null;
            }


            @Override
            public List<Map<String, Object>> getLimitedListByHql(String q, int i, int i1) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getListByHql(String hql) {
                return null;
            }

            @Override
            public List<Map<String, Object>> getLimitedListByQ(String q) {
                return null;
            }

            @Override
            public String getGroupUuidsByIds(String ids) {
                return null;
            }
        };
    }
}
